﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient; 
namespace RSM.Business
{
   public class Xmlreader
    {
        public static DataTable GetXML()
        {
            DataTable dt = null;
            DataSet ds = new DataSet();
            using (SqlConnection con = new SqlConnection())
            {
                con.ConnectionString = Connectionreader.GetDataBaseConnectionString();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "select definition from dbo.ContentTypes where definition is not null";
                cmd.Connection = con;
                con.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(ds, "Columns");
                dt = ds.Tables["Columns"];
            }
            return dt;
        }
    }
}
